//package com.lilosoft.core.executor.work;
//
//import java.util.HashMap;
//import java.util.concurrent.atomic.AtomicInteger;
//
//import org.springframework.beans.factory.annotation.Autowired;
//
//import com.lilosoft.core.executor.structs.TasksQueue;
//
//public abstract class AbstractWork implements Runnable {
//	
//	public static int MAX_SEND = 3;								//分发最大尝试次数
//	public AtomicInteger maxTrySend = new AtomicInteger(0);		//分发当前尝试次数
//	
////	@Autowired
////	protected GdmsBaseService gdmsBaseService;
////	
////	@Autowired
////	protected GdmsRepairService gdmsRepairService;
//	
//	private TasksQueue<AbstractWork> tasksQueue;
//	
//	private String id;
//
//	
////	@SuppressWarnings("rawtypes")
////	public static final HashMap<String, Class> clientMap = new HashMap<String, Class>() {
////        private static final long serialVersionUID = 1L;
////        {
////            put("01", NaturalPersonWork.class);		// 分发自然人申报办件
////            put("02", LegalPersonWork.class);		// 分发法人申报办件
////            put("03", RepairWork.class);			// 分发补齐补正
////        }
////    };
//
//    /**
//     * 根据类型编码，反射创建分发任务线程对象
//     * @param code
//     * @param id
//     * @param gdmsBaseService
//     * @return
//     */
//	@SuppressWarnings("rawtypes")
//	public static AbstractWork getClientHandler(String code, String id, GdmsBaseService gdmsBaseService, GdmsRepairService gdmsRepairService) {
//		Class clazz = clientMap.get(code);
//		AbstractWork wwork = null;
//		try {
//			if(clazz != null) {
//				wwork = (AbstractWork)clazz.newInstance();	//创建对象
//				wwork.setId(id);
//				wwork.setGdmsBaseService(gdmsBaseService);
//				wwork.setGdmsRepairService(gdmsRepairService);
//			}
//		} catch (InstantiationException e) {
//			e.printStackTrace();
//		} catch (IllegalAccessException e) {
//			e.printStackTrace();
//		}	
//		return wwork;
//	}
//	
//	public TasksQueue<AbstractWork> getTasksQueue() {
//		return tasksQueue;
//	}
//
//	public void setTasksQueue(TasksQueue<AbstractWork> tasksQueue) {
//		this.tasksQueue = tasksQueue;
//	}
//
//	public String getId() {
//		return id;
//	}
//
//	public void setId(String id) {
//		this.id = id;
//	}
//
////	public GdmsBaseService getGdmsBaseService() {
////		return gdmsBaseService;
////	}
////
////	public void setGdmsBaseService(GdmsBaseService gdmsBaseService) {
////		this.gdmsBaseService = gdmsBaseService;
////	}
////
////	public GdmsRepairService getGdmsRepairService() {
////		return gdmsRepairService;
////	}
////
////	public void setGdmsRepairService(GdmsRepairService gdmsRepairService) {
////		this.gdmsRepairService = gdmsRepairService;
////	}
////	
//	
//}
